package com.itheima.health.mapper;

import com.itheima.health.dto.SetmealCount;
import com.itheima.health.pojo.Order;
import com.itheima.health.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 预约DAO
 */
@Mapper
public interface OrderMapper {

    void insert(Order order);

    @Select("select count(*) from t_order where member_id = #{id} and orderDate = #{now}")
    Integer selectCountByDateAndMemberId(@Param("now") Date now, @Param("id") Integer id);

    OrderVO selectById(Integer id);

    Integer countByMap(Map map);

    List<SetmealCount> selectSetmealAvaildCount();
}
